import os
import time

import sys

#take all the uknown and deleted,or something else classes xx


def do_it(action):
    print "The action is : ",action
    general_command = "svn "
    command = "svn status"
    try :
        command = os.popen2(command)
        command = command[1].read().split('\n')
    
        #print command
        for deleter in command:
            if deleter.startswith('!') or deleter.startswith('?'):
                ops=os.popen2("".join([general_command,action," ",deleter.split()[1].strip()]))
                print "The file actioned with svn !",deleter.split()[1]
                time.sleep(3)

    except Exception,e:
        print "Something bad happened :) ",e


if __name__=="__main__":
    if len(sys.argv)!=2:
        print "Usage is : python <program> <command>"
        sys.exit(1)

    #print "The command is :",sys.argv[1]
    do_it(sys.argv[1].strip())# you can do it
